<template>
    <div>
       <headNav></headNav>
       <div class="head"></div>
       <div class="content">  
               <div class="dr_detail">
                <div class="dr_tit" v-if="type==1">文化达人</div>
                <div class="dr_tit" v-if="type==2">科学达人</div>
                <div class="dr_tit" v-if="type==3">运动达人</div>
                <div class="dr_tit" v-if="type==4">劳动达人</div>
                <div class="dr_tit" v-if="type==5">艺术达人</div>
                <div class="dr_tit" v-if="type==0">其它达人</div>
                <div class="info1">
                      <img class="avt" :src="'https://eduvideo.hangzhou.com.cn'+info.poster" alt="">
                      <div style="margin-left: 30px;">
                         <p class="name">{{ info.name }}</p>
                         <p class="name1">{{info.area.name}}</p>
                      </div>
                </div>
                <div class="water_div">
                    <vue-waterfall-easy @click="handleWater" :reachBottomDistance="30" :gap="10" :width="1400" :imgWidth="340" :imgsArr="imgsArr" @scrollReachBottom="getData">
                    <div class="info" slot-scope="props">
                      <p class="infop p1">{{props.value.title}}</p>
                      <p class="infop p2">{{props.value.school}}</p>
                    </div>
                    </vue-waterfall-easy>
    
                </div>
               </div>
        </div>
       <footCom></footCom>
       
    </div>
  </template>
  
  <script>
import vueWaterfallEasy from 'vue-waterfall-easy';

import footCom from '@/common/foot.vue';
import headNav from '@/common/headNav.vue';

export default {
    name: 'drDetail',
    components:{
     headNav,
     footCom,
     vueWaterfallEasy,
  },
    data(){
      return{
         id:'',
         page:1,
         imgsArr:[],
         info:{
            area:{name:''}
         },
      }
    },
    created(){
        this.id = this.$route.query.id
        this.type = this.$route.query.type
        this.getData()
    },
    methods:{
        getData(){
            this.$axios.get('https://eduvideo.hangzhou.com.cn/api/v1/get_talent_works?talent_id='+this.id+'&page='+this.page).then((res)=>{
                this.info = res.data.data.info
                var obj = {}
                var arr = []
                res.data.data.works.data.forEach(item=>{
                        obj.title = item.title
                        obj.school = item.school
                        obj.id = item.id
                        // if(item.type==1){
                        //     obj.src = item.files[0].file_cover
                        // }else{
                        //     obj.src =item.files[0].full_file_path
                        // }
                        obj.src =item.poster
                        arr.push(obj)
                })
                this.imgsArr = this.imgsArr.concat(arr)
                this.page++
            })
          
        },
        handleWater(item,val){
      // window.open(item.href, '_blank');
       this.$router.push({
           path:'/workDetail',
           query:{
            id:val.value.id
           }
       })
    },
    }
  }
</script>
  
  <!-- Add "scoped" attribute to limit CSS to this component only -->
  <style scoped>
  .head{
    width: 100%;
    height: 464px;
    background: url('./../static/images/banner.jpg') no-repeat center top;
  }
  .content{
    width: 100%;
    height: 1400px;
    background: url('./../static/images/detail_con.png') no-repeat;
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
  }
  .dr_detail{
    width: 1400px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }
  .dr_tit{
    color: #fff;
    font-size: 36px;
  }
  .info1{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    margin-top: 30px;
  }
  .avt{
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #fff;
  }
  .name{
    font-size: 18px;
    font-weight: bolder;
    color: #fff;
  }
  .name1{
    font-size: 16px;
    color: #fff;
  }
  .water_div>>>.vue-waterfall-easy-container .vue-waterfall-easy a.img-inner-box{
    box-shadow: none !important;
    border-radius:none !important;
  }
  .water_div{
    width: 1400px;
    height: 1000px;
  
  }
  .water_div{
    width: 1400px;
    height: 1000px;
  
  }
  .water_div>>>.vue-waterfall-easy-container::-webkit-scrollbar ,.water_div>>>.vue-waterfall-easy-scroll::-webkit-scrollbar {
    width: 0 !important;
    background-color: #f9f9f9;
  }
  .infop{
    margin: 0;
    padding: 0;
  }
  .info{
    margin-bottom: 50px;
    background-color: transparent;
    border: none !important;
    box-shadow: none !important;
  }
  .p1{
    margin: 25px 0 20px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    width: calc(100% - 7px);
    line-height: 25px;
    padding-left: 7px;
    font-size: 20px;
    color: #fff;
  }
  .p2{
    padding-left: 7px;
    color: #9fc9e2;
    font-size: 18px;
  }
  </style>
  